Skip to content

feat(tools): waves A/B/C — cleanup + 10 new gemmological widgets#21

Merged
Bissbert merged 3 commits into
mainfrom
feature/tools-wave-c
May 5, 2026
Merged

feat(tools): waves A/B/C — cleanup + 10 new gemmological widgets#21
Bissbert merged 3 commits into
mainfrom
feature/tools-wave-c

Conversation

@Bissbert
Copy link
Copy Markdown
Contributor

@Bissbert Bissbert commented May 5, 2026

Summary

End-to-end execution of the tools-section plan. Three waves bundled in one PR (per-wave branches were not split — all work landed on feature/tools-wave-c).

The site stays purely gemmological — no pricing widgets. All advertising for "price per carat" has been removed from the hub copy.

Wave A — Cleanup (a31a382)

  • Removed price-per-carat advertising from ToolsHub.tsx and tools/conversions.astro.
  • Fixed misleading hub copy (no more "pleochroism reference" / "compare side-by-side" / "origin characteristics" promises).
  • Refractometer Simulator now surfaces over-the-limit behaviour as a teaching panel rather than silently dropping diamonds and other OTL gems.
  • Mobile grids on SGCalculator and CaratEstimator stack one-per-row at 375 px instead of squeezing.
  • Added Learn-more links from Measurement category to /learn/physical-properties and /learn/optical-properties.

Wave B — Six new widgets (5837da4, +1677 LoC)

Route Widget
/tools/optical Pleochroism Reasoner — colour-count + colour input → ranked candidates
/tools/measurement Hanneman/Hodgkinson short-cut RI — contact-liquid relief inference for OTL
/tools/advanced GIA cut-grade overlay on Proportion Analyzer (round brilliant)
/tools/measurement Carat Estimator — girdle-thickness factor (1.00–1.12)
/tools/measurement RI Lookup — double-reading mode → birefringence + DR/SR
/tools/measurement SG Calculator — water-temperature correction (4–30 °C)

Wave C — Four reasoning widgets (b350044, +2102 LoC)

Route Widget Approach
/tools/lab UV Fluorescence Lookup Parses freeform fluorescence field; flags chalky-SWUV in corundum as heat-treatment indicator
/tools/lab Spectroscope Band-Matcher Inverse to display-only SpectroscopeCalculator; ticks observed bands → ranked species across 16-entry curated reference table
/tools/advanced Treatment Wizard 18 clues × 11 treatments evidence weighting; supports +/− contributions and confidence bands
/tools/optical Optic Sign / 2V Reasoner uniaxial ε−ω; biaxial β-position rule; 2V via Mallard cos²Vz formula

Pragmatic data layering: Wave-C widgets reason against the existing freeform DB columns plus TypeScript reference tables, avoiding a multi-day Python schema migration. A future mineral-database schema upgrade can populate fluorescence_lwuv / fluorescence_swuv / absorption_bands_json / optic_sign SQL columns without breaking these widgets.

Test plan

  • npx vitest run288/288 tests pass across 20 test files
  • npm run build — clean build, 912 pages
  • All four Wave-C widgets render with DB unavailable (graceful empty state)
  • Reference checks: ruby chrome doublet (693/555/476) → ranked top in band-matcher; Tolkowsky proportions (57/61.5/34.5°/40.75°) → "Excellent" in cut-grade overlay; chalky SWUV in corundum → treatment red-flag triggered

Out of scope (per plan)

  • Any pricing / market-value / appraisal feature.
  • mineral-database SQL schema migration (deferred — TypeScript layer covers it for v1).

Bissbert added 3 commits May 5, 2026 20:15
…bile grids

The tools hub advertised features that did not exist (price-per-carat
calculator, side-by-side gem comparison, origin characteristics guide,
pleochroism reference) and the refractometer simulator silently dropped
gems with RI > 1.81 — exactly the over-the-limit teaching moment it
should surface. Several calculator grids also rendered fixed two- or
three-column layouts on phones.

Changes
- ToolsHub: rewrite four card descriptions to match what is actually
  rendered. Pricing is intentionally out of scope (purely gemmological
  site, gem prices change constantly).
- conversions.astro: drop pricing copy from page title and meta
  description.
- RefractometerSimulator: keep over-the-limit gems in the dropdown and
  render an "Over the limit — continuously bright field, no shadow edge"
  panel instead of silently filtering them out.
- SG, Birefringence, RI Lookup, Length, Temperature, Carat (two grids):
  add 'grid-cols-1' fallback with 'md:grid-cols-N' for proper mobile
  stacking.
- MeasurementTools: add a Learn-more block linking to
  /learn/equipment/sg-measurement, /learn/equipment/refractometer, and
  the optical/physical-properties fundamentals pages.
Wave B adds six pure-gemmology tools and upgrades, all reusing the
existing component patterns and mineral database:

* B1 — Pleochroism Reasoner (/tools/optical): observed colour count and
  colours rank candidate species and explain isotropic/uniaxial/biaxial
  systems.
* B2 — Hanneman/Hodgkinson short-cut RI (/tools/measurement): contact-
  liquid relief observations bracket the RI band of over-the-limit and
  rough stones, then filter the database to candidate species.
* B3 — GIA-style cut-grade overlay on ProportionAnalyzer for diamond
  round-brilliants: per-parameter grades plus a "limiting parameter"
  callout.
* B4 — Carat Estimator: girdle-thickness multiplicative correction
  (1.00–1.12) on the L×W×D×SG×factor estimate.
* B5 — RI Lookup: optional double-reading mode infers birefringence and
  optic character (SR/DR) and looks up gems by the average RI.
* B6 — SG Calculator: water-temperature correction using a NIST-derived
  ρ_water interpolation table.

All new pure logic ships with vitest coverage; full suite is green
(245/245), production build passes (912 pages).
…reasoner

Adds four new gemmological reasoning widgets backed by pure-TypeScript
parsers and reference tables, avoiding a multi-day Python schema
migration on the mineral-database package. The same data can later be
populated into SQL columns without breaking these widgets.

C1 — UV fluorescence lookup (`/tools/lab`): parses the freeform
`fluorescence` field for LWUV / SWUV / phosphorescence and ranks
candidates by colour and intensity. Surfaces a treatment red flag for
chalky SWUV in corundum (heat-treatment indicator).

C2 — Spectroscope band-matcher (`/tools/lab`): inverse to the
display-only SpectroscopeCalculator. User ticks observed absorption
lines on a colour-coded wavelength scale; widget ranks 16 species from
a curated reference table (chrome doublet, didymium, almandine 504/527,
zircon U-line, peridot triplet, cape diamond N3, etc.). Selective
(diagnostic) bands dominate the ranking.

C3 — Treatment-detection wizard (`/tools/advanced`): pick the gem kind,
tick observed clues (silk halos, chalky SWUV, flash effect, surface
bubbles, residue, jadeite acid-etch, HPHT decolourisation, …); evidence
weighting produces a ranked likelihood per treatment with positive and
negative supporting clues.

C4 — Optic-sign / 2V reasoner (`/tools/optical`): user enters polariscope
result + ω/ε (uniaxial) or α/β/γ (biaxial); widget computes optic sign,
birefringence, and 2V via Mallard's formula, then ranks species whose
parsed `optical_character` matches the observation.

All four ship with vitest coverage of their pure matchers (parsers,
sign rules, scoring functions). 288/288 tests pass; build green.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

🚀 Preview deployed to: https://d6690cde.gemmology-dev.pages.dev

@Bissbert Bissbert merged commit 4971bd1 into main May 5, 2026
3 of 4 checks passed
@Bissbert Bissbert deleted the feature/tools-wave-c branch May 5, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant